#!/usr/bin/sh

iisreset

# make sure that the changelog is up to date
make changelog

# build needed directories
mkdir -p ../dist
rm -rf ../tmp
mkdir -p ../tmp
cd ../tmp
cvs export -D now NVelocity 

# make sure that /bin files are executable
cd NVelocity/bin
chmod a+x *.exe
chmod a+x *.dll

# make binaries and docs
cd ../src
make build docs
cd ..

# remove extra directories needed for VS.IDE build bug
rm -rf build/commons
rm -rf build/http
rm -rf build/nant
rm -rf build/nvelocity

# remove unneeded directories for release
rm -rf docs/api
prune.sh

# jar up release
jar -cMvf ../../dist/NVelocity-0.4.1.zip *

# clean up
cd ../../src
rm -rf ../tmp